<template>
	<view class="web" v-if="url">
		<!-- <view class="web_hd">
			<uni-icons type="left" size="30" @tap="getPrev"></uni-icons>
			<view class="hd_txt">
				鸡蛋
			</view>
		</view> -->
		<view class="web_txt">
			<web-view :src="`${url}`" :webview-styles="webviewStyles" @message="getH5Message"></web-view>
		</view>
	</view>
</template>
<!-- uni 的 SDK -->


<script>
	export default {
		data() {
			return {
				url: null,
				webviewStyles: {
					progress: {
						color: '#FF3333'
					},
					top: '100px',
				}

			};
		},
		onLoad(k) {
			this.url = k.url
			console.log(k.url)
			setTimeout(() => {
				console.log('------------------》', this.$mp)
				// console.log(this.$parent.$scope.$getAppWebview())
			})
			// 
			// let height = 0;
			// uni.getSystemInfo({
			// 	success() {
			// 		height = sysinfo.windowHeight - 47;
			// 		console.log(height)
			// 	}
			// })
		},
		onReady() {

		},
		// 监听按钮的点击事件
		onNavigationBarButtonTap(e) {
			if (e.index) {
				console.log(e.index)
				//点击菜单按钮执行的代码
			} else {
				console.log(e)
				//点击返回按钮执行的代码
			}

		},



		methods: {
			getH5Message(e) {
				console.log(e)
			}
		}
	}
</script>

<style lang="scss">
	.web {
		width: 100%;

		// position: relative;
		.web_hd {
			// position: absolute;
			// top: 0;
			// position: fixed;
			width: 92%;
			margin: 0 auto;
			background-color: #fff;
			z-index: 999 !important;
			display: flex;
			align-items: center;

			.hd_txt {
				font-size: 36rpx;
			}
		}

		.web_txt {
			width: 100%;
		}
	}
</style>
